#ifndef __MCU_HARDWARE_HARDWARE_UART_H
#define __MCU_HARDWARE_HARDWARE_UART_H

#include "headfile.h"
#include "outputStream.h"
#include "inputStream.h"

class HardwareUART : public outputStream, public inputStream
{
    UART_enum uart_x;
    int baudrate;
    void set_buf_ptr();

public:
    HardwareUART(UART_enum uart)
    {
        // uart_init(uart, baudrate);
        uart_x = uart;
        set_buf_ptr();
    };

    int begin(int buadrate_in = 115200)
    {
        baudrate = buadrate_in;
        uart_init(uart_x, buadrate_in);
        return 1;
    };
    int end() { return 1; };

    virtual size_t write(uint8_t);
    virtual size_t write(const uint8_t *buffer, size_t size);
};

#endif
